﻿using LanguagePolish.Base;
using LanguagePolish.EntityModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LanguagePolish.ViewModels
{
    class AddClassroomViewModel : BaseViewModel
    {
        public Classroom Classroom { get; private set; }

        public string Title { get; private set; }

        public bool HasErrors { get { return Classroom.HasErrors; } }

        public AddClassroomViewModel(Classroom classroom, bool isEdit = false)
        {
            Classroom = classroom;
            InitTitle(isEdit);
        }

        private void InitTitle(bool isEdit)
        {
            Title = isEdit ? "Edit Classroom" : "Add New Classroom";
            OnPropertyChanged("Title");
        }
    }
}
